//
//  HMComposeButton.swift
//  Black22
//
//  Created by Apple on 16/11/24.
//  Copyright © 2016年 KY. All rights reserved.
//

import UIKit

class HMComposeButton: UIButton {

//    override var isHighlighted: Bool {
//        get {
//            return false
//        } set {
//            
//        }
//    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI() {
        setTitleColor(UIColor.gray, for: .normal)
        titleLabel?.font = UIFont.systemFont(ofSize: 14)
        titleLabel?.textAlignment = .center
        imageView?.contentMode = .center
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.frame.size.width = self.bounds.width
        imageView?.frame.size.height = self.bounds.width
        
        titleLabel?.frame.size.width = self.bounds.width
        titleLabel?.frame.size.height = self.bounds.height - self.bounds.width
        
        imageView?.frame.origin.y = 0
        titleLabel?.frame.origin.x = 0
        titleLabel?.frame.origin.y = self.bounds.width
        
        
        
    }

}
